{% extends 'base.html' %}
{% load thumbnail %}
{% load static %}

{% block content %}
    <div class="main">
        <h2>People found: {{ users.count }}</h2>
        <div class="line"></div>
        {% for user in users %}
            <div class="people">
                {% if not user.profile.photo %}
                    <div class="image">
                        <img src="{% static 'images/dog.jpg' %}" class="no-photo">
                    </div>
                {% else %}
                    <div class="image">
                        {% thumbnail user.profile.photo "100x100" crop="60%" as im %}
                            <img src="{{ im.url }}">
                        {% endthumbnail %}
                    </div>
                {% endif %}
                <div class="info">
                    <a href="{% url 'user_detail' username=user.username %}">{{ user.username }}</a>
                </div>
            </div>
        {% endfor %}
    </div>
    <style>

        .info a {
            cursor: pointer;
            color: #DDD;
        }

        .line {
            width: 50%;
            margin-bottom: 3em;
        }

        .main {
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .main .info{
            margin-left: 1em;
        }

        .no-photo {
            width: 100px;
            height: 100px;
        }

        .people {
            border-radius: 8px;
            margin-bottom: 20px;
            padding: 10px;
            width: 50%;
            background-color: #1c1e21;;
            display: flex;
            align-items: center;
        }

        .people img{
            border-radius: 50%;
        }

        .main span {
            color: #DDD;
        }

    </style>
        
{% endblock content %}
